<div class="container shadow p-3" id="user-base" xmlns:th="http://www.thymeleaf.org">
<form id="ms-form-user-base" class="row g-3"
      th:with="user=${session.loginUser}">

    <div class="col-md-4">
        <label for="ms-form-user-base-code" class="form-label ">账号</label>
        <input name="usercode" readonly type="text" class="form-control is-valid placeholder" id="ms-form-user-base-code" th:value="${user.getUsercode()}">
        <div class="valid-feedback">
            提示: 账号不可更改
        </div>
    </div>

    <div class="col-md-4 placeholder">
        <label for="ms-form-user-base-username" class="form-label">用户名</label>
        <input name="username" type="text" class="form-control placeholder" id="ms-form-user-base-username" th:value="${user.getUsername()}" placeholder="">
        <div class="valid-feedback placeholder">
            提示: 格式正确!
        </div>
        <div id="ms-form-user-base-username-fail" class="invalid-feedback">
            提示: 用户名不能为空
        </div>
    </div>

    <div class="col-md-3">
        <label for="ms-form-user-base-tel" class="form-label">联系方式</label>
        <input name="tel" type="text" class="form-control placeholder" id="ms-form-user-base-tel" th:value="${user.getTel()}">
        <div class="valid-feedback placeholder">
            提示: 格式正确!
        </div>
        <div id="ms-form-user-base-tel-fail" class="invalid-feedback">
            提示: 联系方式不能为空
        </div>
    </div>
    <div class="col-md-1"></div>
    <div class="col-md-3">
        <label for="ms-form-user-base-birthday" class="form-label">生日</label>
        <input name="birthday" type="date" class="form-control placeholder" id="ms-form-user-base-birthday" th:value="${#dates.format(user.getBirthday(), 'yyyy-MM-dd')}">
        <div class="valid-feedback placeholder">
            提示: 格式正确!
        </div>
        <div class="invalid-feedback">
            提示: 生日不能为空
        </div>
    </div>
    <div class="col-md-8 align-self-end">
        <label class="form-label">性别</label>
        <div class="form-check-inline placeholder align-self-end">
            <input class="form-check-input" type="radio" name="gender" value="1" id="ms-form-user-base-gender-1" th:checked="${user.getGender() == 1}">
            <label class="form-check-label" for="ms-form-user-base-gender-1">
                男
            </label>
        </div>
        <div class="form-check-inline placeholder align-self-end">
            <input class="form-check-input" type="radio" name="gender" value="0" id="ms-form-user-base-gender-0" th:checked="${user.getGender() == 0}">
            <label class="form-check-label" for="ms-form-user-base-gender-0">
                女
            </label>
        </div>
    </div>

    <nav class="col-md-3 align-self-end">
        <label for="ms-form-user-base-province" class="form-label">省</label>
        <select name="provinceCode" id="ms-form-user-base-province" class="form-select placeholder">
        </select>
    </nav>
    <div class="col-md-1"></div>
    <nav class="col-md-3 align-self-end">
        <label for="ms-form-user-base-city" class="form-label">市</label>
        <select name="cityCode" id="ms-form-user-base-city" class="form-select placeholder">
        </select>
    </nav>
    <div class="col-md-1"></div>
    <nav class="col-md-3 align-self-end">
        <label for="ms-form-user-base-area" class="form-label">区</label>
        <select name="areaCode" id="ms-form-user-base-area" class="form-select placeholder">
        </select>
    </nav>
    <div class="col-12">
        <label for="ms-form-user-base-address" class="form-label placeholder">详细地区</label>
        <input name="address" type="text" class="form-control" id="ms-form-user-base-address" placeholder="" th:value="${user.getAddress().substring(user.getAddress().lastIndexOf('-') + 1)}">
        <div class="valid-feedback">
            提示: 格式正确!
        </div>
        <div id="ms-form-user-base-address-fail" class="invalid-feedback placeholder">
            提示: 详细地区不能为空
        </div>
    </div>
    <div class="col-12 text-center">
        <button id="user-base-save" type="button" class="btn btn-warning w-50 placeholder" onclick="saveUserBase('user-base-save')">保存</button>
    </div>
</form>
</div>